package p270jp.pxv.android.viewholder;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.lifecycle.AbstractC0721k;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;
import p062c4.ViewBindings;
import p064c6.Preconditions;
import p181ge.AdViewHolder;
import p189gn.AbstractC3435a;
import p216hn.Reflection;
import p270jp.pxv.android.R;
import p270jp.pxv.android.advertisement.presentation.view.GridSelfServeView;
import p270jp.pxv.android.legacy.model.GoogleNg;
import p284ke.AdUtils;
import p314lg.ViewSelfServeGridItemBinding;
import p325m0.MutabilityOwnership;
import p376no.Koin;
import p404oo.AbstractC5475a;
import p521th.FlexibleItemAdapterSolidItem;
import p521th.SolidItemViewHolder;
import p579vo.Qualifier;
import p603wm.AbstractC6949c;

/* compiled from: IllustGridAdsSolidItem.kt */
/* renamed from: jp.pxv.android.viewholder.IllustGridAdsSolidItem */
/* loaded from: classes2.dex */
public final class IllustGridAdsSolidItem extends FlexibleItemAdapterSolidItem implements AbstractC5475a {
    public static final int $stable;
    private final AbstractC6949c adUtils$delegate = Preconditions.m9802P(1, new AbstractC3435a<AdUtils>(null, null) { // from class: jp.pxv.android.viewholder.IllustGridAdsSolidItem$special$$inlined$inject$default$1
        public final /* synthetic */ AbstractC3435a $parameters;
        public final /* synthetic */ Qualifier $qualifier;

        {
            this.$qualifier = r2;
            this.$parameters = r3;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [java.lang.Object, ke.a] */
        @Override // p189gn.AbstractC3435a
        public final AdUtils invoke() {
            Koin koin = AbstractC5475a.this.getKoin();
            return koin.f24118a.m920a().m621a(Reflection.m5499a(AdUtils.class), this.$qualifier, this.$parameters);
        }
    });

    /* compiled from: IllustGridAdsSolidItem.kt */
    /* renamed from: jp.pxv.android.viewholder.IllustGridAdsSolidItem$GridSelfServeAdsSolidItemViewHolder */
    /* loaded from: classes2.dex */
    public static final class GridSelfServeAdsSolidItemViewHolder extends SolidItemViewHolder implements LifecycleObserver, AdViewHolder {
        public static final int $stable;
        private final ViewSelfServeGridItemBinding binding;
        private GoogleNg googleNg = GoogleNg.WHITE;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public GridSelfServeAdsSolidItemViewHolder(ViewSelfServeGridItemBinding lbVar) {
            super(lbVar.f21905a);
            MutabilityOwnership.m3745m(lbVar, "binding");
            this.binding = lbVar;
        }

        public GoogleNg getGoogleNg() {
            return this.googleNg;
        }

        @Override // p181ge.AdViewHolder
        public void handleOnAttached() {
        }

        @Override // p181ge.AdViewHolder
        public void handleOnDetached() {
            this.binding.f21906b.m4668w();
        }

        @OnLifecycleEvent(AbstractC0721k.EnumC0723b.ON_PAUSE)
        public final void handleOnPause() {
            this.binding.f21906b.m4668w();
        }

        @Override // p521th.SolidItemViewHolder
        public void onBindViewHolder(int i) {
            GridSelfServeView gridSelfServeView = this.binding.f21906b;
            ((ImageView) gridSelfServeView.f18788v.f5402c).setImageDrawable(null);
            gridSelfServeView.f18788v.getRoot().setOnClickListener(null);
            this.binding.f21906b.m4667x(getGoogleNg());
        }

        @Override // p181ge.AdViewHolder
        public void setGoogleNg(GoogleNg googleNg) {
            MutabilityOwnership.m3745m(googleNg, "<set-?>");
            this.googleNg = googleNg;
        }
    }

    private final AdUtils getAdUtils() {
        return (AdUtils) this.adUtils$delegate.getValue();
    }

    @Override // p404oo.AbstractC5475a
    public Koin getKoin() {
        return AbstractC5475a.C5476a.m3211a(this);
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public SolidItemViewHolder onCreateViewHolder(ViewGroup viewGroup) {
        MutabilityOwnership.m3745m(viewGroup, "parent");
        View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.view_self_serve_grid_item, viewGroup, false);
        GridSelfServeView gridSelfServeView = (GridSelfServeView) ViewBindings.m9835b(inflate, R.id.ad_container);
        if (gridSelfServeView != null) {
            return new GridSelfServeAdsSolidItemViewHolder(new ViewSelfServeGridItemBinding((ConstraintLayout) inflate, gridSelfServeView));
        }
        throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(R.id.ad_container)));
    }

    @Override // p521th.FlexibleItemAdapterSolidItem
    public boolean shouldBeInserted(int i, int i2, int i3, int i4) {
        return getAdUtils().m4078a() && i / 2 == (i3 * 15) + 8;
    }
}
